﻿#region Using Directives
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.ComponentModel.Design;
using NiSis.Entities;
using NiSis.Data;
using NiSis.Data.Bases;
#endregion

namespace NiSis.Web.Data
{
	/// <summary>
	/// Represents the DataRepository.VTputenzePoolProvider object that provides
	/// data to data-bound controls in multi-tier Web application architectures.
	/// </summary>
	[CLSCompliant(true)]
	[Designer(typeof(VTputenzePoolDataSourceDesigner))]
	public class VTputenzePoolDataSource : ReadOnlyDataSource<VTputenzePool>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VTputenzePoolDataSource class.
		/// </summary>
		public VTputenzePoolDataSource() : base(DataRepository.VTputenzePoolProvider)
		{
		}

		#endregion Constructors
		
		#region Properties
		
		/// <summary>
		/// Gets a reference to the VTputenzePoolDataSourceView used by the VTputenzePoolDataSource.
		/// </summary>
		protected VTputenzePoolDataSourceView VTputenzePoolView
		{
			get { return ( View as VTputenzePoolDataSourceView ); }
		}
		
		#endregion Properties
		
		#region Methods

		/// <summary>
		/// Creates a new instance of the VTputenzePoolDataSourceView class that is to be
		/// used by the VTputenzePoolDataSource.
		/// </summary>
		/// <returns>An instance of the VTputenzePoolDataSourceView class.</returns>
		protected override BaseDataSourceView<VTputenzePool, Object> GetNewDataSourceView()
		{
			return new VTputenzePoolDataSourceView(this, DefaultViewName);
		}
		
		/// <summary>
        /// Creates a cache hashing key based on the startIndex, pageSize and the SelectMethod being used.
        /// </summary>
        /// <param name="startIndex">The current start row index.</param>
        /// <param name="pageSize">The current page size.</param>
        /// <returns>A string that can be used as a key for caching purposes.</returns>
		protected override string CacheHashKey(int startIndex, int pageSize)
        {
			return String.Format("{0}:{1}:{2}", SelectMethod, startIndex, pageSize);
        }
		
		#endregion Methods
	}
	
	/// <summary>
	/// Supports the VTputenzePoolDataSource control and provides an interface for
	/// data-bound controls to perform data operations with business and data objects.
	/// </summary>
	public class VTputenzePoolDataSourceView : ReadOnlyDataSourceView<VTputenzePool>
	{
		#region Declarations

		#endregion Declarations
		
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the VTputenzePoolDataSourceView class.
		/// </summary>
		/// <param name="owner">A reference to the VTputenzePoolDataSource which created this instance.</param>
		/// <param name="viewName">The name of the view.</param>
		public VTputenzePoolDataSourceView(VTputenzePoolDataSource owner, String viewName)
			: base(owner, viewName)
		{
		}
		
		#endregion Constructors
		
		#region Properties

		/// <summary>
		/// Gets a strongly-typed reference to the Owner property.
		/// </summary>
		internal VTputenzePoolDataSource VTputenzePoolOwner
		{
			get { return Owner as VTputenzePoolDataSource; }
		}

		/// <summary>
		/// Gets a strongly typed reference to the Provider property.
		/// </summary>
		internal VTputenzePoolProviderBase VTputenzePoolProvider
		{
			get { return Provider as VTputenzePoolProviderBase; }
		}

		#endregion Properties
		
		#region Methods
		
		#endregion Methods
	}

	#region VTputenzePoolDataSourceDesigner

	/// <summary>
	/// Provides design-time support in a design host for the VTputenzePoolDataSource class.
	/// </summary>
	public class VTputenzePoolDataSourceDesigner : ReadOnlyDataSourceDesigner<VTputenzePool>
	{
	}

	#endregion VTputenzePoolDataSourceDesigner

	#region VTputenzePoolFilter

	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilter&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VTputenzePool"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VTputenzePoolFilter : SqlFilter<VTputenzePoolColumn>
	{
	}

	#endregion VTputenzePoolFilter

	#region VTputenzePoolExpressionBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlExpressionBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="VTputenzePool"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class VTputenzePoolExpressionBuilder : SqlExpressionBuilder<VTputenzePoolColumn>
	{
	}
	
	#endregion VTputenzePoolExpressionBuilder		
}

